cmake_minimum_required( VERSION 2.8 )
project("rzld")
find_package( Qt4 REQUIRED )
include( ${QT_USE_FILE} )
INCLUDE_DIRECTORIES(
    ${QT_INCLUDE_DIR}
    ${CMAKE_CURRENT_BINARY_DIR}
    ../qxmlrpc
)

set( HEADERS
        mdxserver.h
        mlog.h
)

set( CPPS
        main.cpp
        mdxserver.cpp
        mlog.cpp
)
set( UIS
        
)

qt4_wrap_ui(UIS_H ${UIS})

qt4_wrap_cpp( MOC_SOURCES ${HEADERS} )

#set( RESOURCES res.qrc )
#qt4_add_resources( QRC_SOURCES ${RESOURCES} )

add_executable( rzld ${CPPS} ${MOC_SOURCES} ${UIS_H} ) #${QRC_SOURCES})

target_link_libraries( rzld ${QT_QTCORE_LIBRARIES} ${QT_QTSQL_LIBRARIES} qxmlrpc)

# install for linux
if(${CMAKE_SYSTEM_NAME} STREQUAL Linux)
    set(rootdir ${CMAKE_INSTALL_PREFIX})
    set(rootdir_bin ${rootdir}/bin)
    install(TARGETS rzld DESTINATION ${rootdir_bin})
endif()
# install for mac os x
if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin)
    set(rootdir ${CMAKE_INSTALL_PREFIX})
    set(rootdir_bin ${rootdir}/bin)
    install(TARGETS rzld DESTINATION ${rootdir_bin})
endif()
